fix(ci): clear github.token extraheader before RELEASE_PAT push#172
Conversation
actions/checkout sets http.extraheader with github.token, which overrides the RELEASE_PAT in the remote URL. Clear the extraheader before pushing so the PAT actually takes effect.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Warning Review limit reached
More reviews will be available in 13 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Problem
Even after setting the remote URL to use RELEASE_PAT, git push still fails with:
The push URL in the error shows
https://github.com/YiAgent/OpenCI.git— not the RELEASE_PAT URL we set.Root Cause
actions/checkoutsetshttp.https://github.com/.extraheaderwithgithub.token. This extra header is sent with ALL git operations to GitHub, overriding the RELEASE_PAT in the URL.Fix
Clear the extraheader before pushing:
no-issue
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.Greptile Summary
This PR fixes a git push failure where
actions/checkoutwas injectinggithub.tokenviahttp.https://github.com/.extraheader, which overrode the RELEASE_PAT credentials in the remote URL on every request. The fix clears the extraheader before pushing and passes the PAT directly in the push URL instead of pre-configuring the remote.git remote set-urlapproach is replaced by an explicitgit config --local --unset-all 'http.https://github.com/.extraheader' || truebefore the push, which is the correct and commonly recommended pattern for this scenario.|| trueappropriately handles the case where the extraheader key is absent (e.g., exit code 5 fromgit config), keeping the script compatible withset -euo pipefail.RELEASE_PATis declared as a secret.Confidence Score: 5/5
Safe to merge — the change is a minimal, targeted fix to a real push failure with no logic regressions.
The fix correctly targets the root cause: actions/checkout's injected extraheader silently wins the auth negotiation over credentials embedded in the remote URL. Clearing it before the push is the established pattern for this problem. The
|| trueguard is appropriate underset -euo pipefail. No other logic in the workflow is altered.No files require special attention; the change is confined to four lines in the push step.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Runner as GitHub Runner participant GitConfig as Git Config participant GitHub as github.com Note over Runner,GitHub: actions/checkout injects github.token Runner->>GitConfig: Set extraheader with github.token Note over Runner,GitHub: OLD push behavior Runner->>GitConfig: set-url origin with PAT in URL Runner->>GitHub: git push origin branch GitHub-->>Runner: Rejected — extraheader overrides PAT creds Note over Runner,GitHub: NEW push behavior (this PR) Runner->>GitConfig: unset-all extraheader Runner->>GitHub: git push PAT-URL branch GitHub-->>Runner: Accepted — only PAT credentials sentReviews (1): Last reviewed commit: "fix(ci): clear extraheader before pushin..." | Re-trigger Greptile